<?php
/**
 * Description of Signup
 * 
 * @author anhdung
 * @since 01-07-2013 - 17:36:53
 */
?>
<div class="row-fluid">
    <div class="login-box">
        <?php if (Yii::app()->user->hasFlash('Error_signup')): ?>
            <div class="flash-error">
                <?php echo Yii::app()->user->getFlash('Error_signup'); ?>
            </div>
        <?php endif; ?>
        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id'                     => 'signup-form',
            'focus'                  => array($model, 'email'),
            'enableClientValidation' => true,
//            'enableAjaxValidation' => true,
            'htmlOptions'            => array(
                'class'   => 'form-horizontal',
                'enctype' => 'multipart/form-data',
            ),
            'clientOptions'          => array(
                'validateOnSubmit' => true,
            ),
        ));
        ?>
        <h1>Webmaster Sign Up</h1>
        <div class="form-box">
            <?php echo $form->labelEx($model, 'email'); ?>
            <?php
            echo $form->textField($model, 'email', array(
                'placeholder' => $model->getAttributeLabel('email'),
                'class'       => 'input-large span12',
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'email'); ?></font>        
        </div>
        <div class="row-fluid form-box">
            <div class="span6">
                <?php echo $form->labelEx($model, 'new_pass'); ?>
                <?php
                echo $form->passwordField($model, 'new_pass', array(
                    'placeholder' => $model->getAttributeLabel('new_pass'),
                    'class'       => 'input-large span12',
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'new_pass'); ?></font>
            </div>
            <div class="span6">
                <?php echo $form->labelEx($model, 'repassword'); ?>
                <?php
                echo $form->passwordField($model, 'repassword', array(
                    'placeholder' => $model->getAttributeLabel('repassword'),
                    'class'       => 'input-large span12',
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'repassword'); ?></font>
            </div>
        </div>
        <div class="row-fluid form-box">
            <div class="span6">
                <?php echo $form->labelEx($model, 'firstname'); ?>
                <?php
                echo $form->textField($model, 'firstname', array(
                    'placeholder' => $model->getAttributeLabel('firstname'),
                    'class'       => 'input-large span12',
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'firstname'); ?></font>
            </div>
            <div class="span6">
                <?php echo $form->labelEx($model, 'lastname'); ?>
                <?php
                echo $form->textField($model, 'lastname', array(
                    'placeholder' => $model->getAttributeLabel('lastname'),
                    'class'       => 'input-large span12',
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'lastname'); ?></font>
            </div>
        </div>
        <?php if (CCaptcha::checkRequirements()): ?>        
            <div class="row-fluid form-box">
                <div class="span6">
                    <?php echo $form->labelEx($model, 'verifyCode'); ?>
                    <?php
                    echo $form->textField($model, 'verifyCode', array('class'       => 'input-large span12',
                        'placeholder' => $model->getAttributeLabel('verifyCode'),
                    ));
                    ?>
                    <font color="red"><?php echo $form->error($model, 'verifyCode'); ?></font>
                </div>
                <div class="span6 text-center">                        
                    <?php
                    $this->widget('CCaptcha', array(
                        'imageOptions' => array('style' => 'display:block;margin:0px auto')
                    ));
                    ?>
                </div>
            </div>
        <?php endif; ?>
        <hr/>
        <div class="clearfix"></div>
        <?php
        echo CHtml::submitButton('Register', array('class' => 'btn btn-info'));
        ?>
        <?php
        echo CHtml::resetButton('Reset', array('class' => 'btn btn-info'));
        ?>
        <?php $this->endWidget(); ?>
    </div><!--/row-->
</div><!--/fluid-row-->
